/**
 * 优惠券
 */
import request from "@/utils/request";

// 优惠券列表
export const getCouponrList = ({ page }) => {
    return request({
        url: `/coupon/${page}`,
        method: "get",
    });
};
// 添加优惠券
export const addCouponr = (data) => {
    return request({
        url: `/coupon`,
        method: "POST",
        data,
    });
};
// 修改内容
export const editCoupon = (id, data) => {
    return request({
        url: `/coupon/${id}`,
        method: "POST",
        data,
    });
};
// 删除
export const delCouponr = (id) => {
    return request({
        url: `/coupon/${id}/delete`,
        method: "POST",
    });
};
// 失效 coupon/:id/update_status
export const invalidCouponr = (id) => {
    return request({
        url: `/coupon/${id}/update_status`,
        method: "POST",
        data: {
            status: 0
        }
    });
};